﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">


  <xsl:template match ="//rss">

    <div style="width:226px;height:247px;overflow:auto;border-style:solid;border-color:black;border-width:1px;padding-top:2px;">
      <xsl:for-each select="/rss/channel">

        <div class="timon-source-img">
          <xsl:element name="a">
            <xsl:attribute name="href">
              <xsl:value-of select="image/link"/>
            </xsl:attribute>
            <xsl:element name="img">
              <xsl:attribute name="src">
                <xsl:value-of select="image/url"/>
              </xsl:attribute>
              <xsl:attribute name="alt">
                <xsl:value-of select="image/title"/>
              </xsl:attribute>
            </xsl:element>
          </xsl:element>
        </div>
        <div class ="timon-background">
          <xsl:for-each select = "item">

            <xsl:if test="position() = 1">

              <br />
              <div class="timon-top-story">Top Story</div>
              <br />
              <br />
              <span class="timon-top-headline">
                <xsl:value-of select="title"/>
              </span>
              <p style="color:black;font-size:12px;">
                <xsl:value-of select="description" disable-output-escaping="yes"/>
              </p>

              <xsl:element name="a">
                <xsl:attribute name="href">
                  <xsl:value-of select="link"/>
                </xsl:attribute>
                <xsl:attribute name="target">
                  _blank
                </xsl:attribute>
                Read More...
              </xsl:element>
              <hr />
            </xsl:if>

            <xsl:if test="position() > 1">
              <span class="timon-headline">
                <xsl:value-of select="title"/>
              </span>

              <span class="timon-readmore">
                <xsl:element name="a">
                  <xsl:attribute name="href">
                    <xsl:value-of select="link"/>
                  </xsl:attribute>
                  <xsl:attribute name="target">
                    _blank
                  </xsl:attribute>
                  <br />
                  <br />
                  Read more...
                </xsl:element>
              </span>
              <br />
              <hr />
            </xsl:if>

          </xsl:for-each>

          <hr />
        </div>
      </xsl:for-each>

    </div>
  </xsl:template>

</xsl:stylesheet>
